<%@ page language="java" pageEncoding="utf-8"%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="m" uri="/cutm_tags"%>
<head>
<title>稿件列表</title>
<style type="text/css">
body {
	width: 790px;
	max-width: 790px;
}
</style>
<script type="text/javascript">
$(document).ready(function(){
	$('.selected').live('click',function(){
		var vallist = [];
		var list = $('input[type=checkbox][name=click2add]:checked');
		for(var i=0;i<list.length;i++){
			vallist.push(list[i].value);
		}
		parent.addSelectedNode2Div(vallist.join(';'));		
	});
	
	var allspit = parent.getAllSelected();
	for(var m=0;m<allspit.length;m++){
		$('input[name=click2add][value="'+allspit[m]+'"]').attr('checked',true);
	}
	
	$('#checkAll').live('click',function(){
		var checked = $(this).attr('checked');
		if(checked){
			$('input[type=checkbox][class="selected"]').not('checked=false').each(function(){
				$(this).click();
			});
		}else{
			$('input[type=checkbox][class="selected"]:checked').each(function(){
				$(this).click();		
			});
		}
	});
});
</script>
</head>
<body>
<table class="list" width="700px">
	<thead>
		<tr>
			<th width="5%">出版<input type="checkbox" id="checkAll"></th>
			<th width="10%">撰稿栏目</th>
			<th width="65%" >标题</th>
			<th width="10%">撰稿人</th>
			<th width="10%">撰稿日期</th>
		</tr>
	</thead>
	<tbody>
		<s:iterator value="manuscripts">
			<tr id="pt${id}">
				<td><input type="checkbox" value="${id}" name="click2add" class="selected"></td>
				<td><m:property value="column" /></td>
				<td class="left"><s:property value="title" /></td>
				<td><s:property value="user.name" /></td>
				<td><s:date name="createDate" format="yyyy-MM-dd" /></td>
			</tr>
		</s:iterator>
	</tbody>
</table>
</body>